Skip to content

[3.8] bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)#26654

Closed
miss-islington wants to merge 1 commit into
python:3.8from
miss-islington:backport-8a4f085-3.8
Closed

[3.8] bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)#26654
miss-islington wants to merge 1 commit into
python:3.8from
miss-islington:backport-8a4f085-3.8

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 10, 2021

Copy link
Copy Markdown
Contributor

This enables, for example, two base Enums to both inherit from str, and then both be mixed into the same final Enum:

class Str1Enum(str, Enum):
    GH- some behavior here

class Str2Enum(str, Enum):
    GH- some more behavior here

class FinalStrEnum(Str1Enum, Str2Enum):
    GH- this now works

(cherry picked from commit 8a4f085)

Co-authored-by: Ethan Furman ethan@stoneleaf.us

https://bugs.python.org/issue44356

… same (pythonGH-26649)

This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum:

    class Str1Enum(str, Enum):
        GH- some behavior here

    class Str2Enum(str, Enum):
        GH- some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        GH- this now works
(cherry picked from commit 8a4f085)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@ethanfurman: Status check is done, and it's a success ✅ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

@ethanfurman: Status check is done, and it's a success ✅ .

@ethanfurman

Copy link
Copy Markdown
Member

3.8 is now in security maintenance mode.

@miss-islington miss-islington deleted the backport-8a4f085-3.8 branch June 10, 2021 20:40
elbehery95 added a commit to elbehery95/mypy that referenced this pull request Feb 20, 2023
elbehery95 added a commit to elbehery95/mypy that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants